www.gusucode.com > UCMS PHP通用建站系统 v1.3.4PHP源码程序 > UCMS PHP通用建站系统 v1.3.4/ucms_v1.3.4/ucms_v1.3.4/ucms/list/index.php
<?php if (!defined('admin')) {exit();} if(!isset($_GET['cid'])) {die('error');} $cid=intval($_GET['cid']); if($cid<1) {die('error');} if(!power('s',$cid)) {die('error');} if(isset($_GET['keyword']) && $_GET['keyword']<>'') {$keyword=$_GET['keyword'];}else {$keyword='';} if(isset($_GET['articlemname'])) {$articlemname=dbstr(htmlspecialchars($_GET['articlemname']));} if(isset($_GET['articlechoose'])) {$articlechoose=dbstr(htmlspecialchars($_GET['articlechoose']));} if(isset($_GET['articleschoose'])) {$articleschoose=dbstr(htmlspecialchars($_GET['articleschoose']));} $link =channel($cid); if($link['ckind']!=2) { adminmsg('','该栏目不是文章栏目'); } if(!$link) {exit;} $cname=$link['cname']; $ifshowthischannel=$link['ifshow']; $csetting=json_decode($link['csetting'],1); //文章来源表,多表管理,GET传入articletable,可以管理其他表里面的数据,表结构必须与该栏目相同,cid也相同 if(isset($_GET['articletable']) && !empty($_GET['articletable'])) { $articletable=dbstr($_GET['articletable']); $articletableuri='&articletable='.$articletable; }else { $articletable=''; $articletableuri=''; } //后台排序方式 if(isset($csetting['temppage_order']) && strlen($csetting['temppage_order'])>5) { $ordersql=$csetting['temppage_order']; }else { //取出排序字段名字 $ordername = $GLOBALS['db'] -> fetchcount("SELECT mname FROM ".tableex('moudle')." where cid='$cid' and mkind=7 limit 1"); if($ordername) {$ordersql=$ordername.' desc,id desc';}else {$ordersql='id desc';} } //管理员字段 if(power('sadmin',0) || power('s',$cid,$power,5)) { $thissql=''; }else { $thissql=" and ifadmin<>'1'"; } //默认显示父分类 if(!empty($keyword)) { unset($csetting['listfidshow']); } if(isset($csetting['listfidshow']) && $csetting['listfidshow']==1) { $fidmoudleinfo = $GLOBALS['db'] -> one("SELECT strarray FROM ".tableex('moudle')." where cid='$cid' and mname='fid'$thissql limit 1"); if($fidmoudleinfo) { $fidmoudlestrarray=explode('|',$fidmoudleinfo['strarray']); if(!isset($fidmoudlestrarray[0]) || $fidmoudlestrarray[0]!=$cid) { unset($csetting['listfidshow']); } }else { unset($csetting['listfidshow']); } } //查询的字段 if(isset($_GET['moudleid'])) {$moudleid=dbstr(htmlspecialchars($_GET['moudleid']));} if(isset($_GET['fid'])) {$fid=intval($_GET['fid']);} if(isset($moudleid) || isset($fid)) { $ifhavemoudle = $GLOBALS['db'] -> fetchcount("SELECT id FROM ".tableex('moudle')." where cid='$cid' and mname='$moudleid'$thissql limit 1"); if(!$ifhavemoudle) {//如果不存在字段 unset($moudleid); unset($fid); } } //不是管理员则不要管理员字段 $query = $GLOBALS['db'] -> query("SELECT * FROM ".tableex('moudle')." where hide<>'1' and cid='$cid' and ifcreated='1' and ifshow='1'$thissql order by morder asc"); $moudle = $GLOBALS['db'] -> fetchall($query); ?> <div id="UMain"> <!-- 当前位置 --> <div id="urHere"><em class="homeico"></em>后台管理 <?php echo(admin_nav($link));?> <div class="list"> <?php if($cid>0) { admin_nav_list($cid); } ?> </div> <?php $tablecreated=1; if(power('sadmin',0) && count($moudle)==0) { echo('栏目字段尚未建立,请先<a style="color:#0000FF" href="?do=sadmin_aindex&cid='.$cid.'">建立栏目字段</a>'); $csetting['articletable']=''; $tablecreated=0; } ?> </div><div id="mainBox"> <h3> <?php if(power('s',$cid,$power,4)) { if(power('s',$cid,$power,5)) { $cidstrcount = $GLOBALS['db'] -> fetchcount("SELECT count(id) FROM ".tableex('str')." where strcid='$cid';"); }else { $cidstrcount = $GLOBALS['db'] -> fetchcount("SELECT count(id) FROM ".tableex('str')." where strcid='$cid' and ifadmin='0';"); } if($cidstrcount>0) { echo('<a href="?do=str&cid='.$cid.'" class="actionBtn" style="margin-left:10px"><em>设置</em></a>'); } } if((!isset($csetting['listnoadd']) || $csetting['listnoadd']==0) && power('s',$cid,$power,1) && $tablecreated) { if(isset($articlechoose)) { echo('<a href="?do=list_add&cid='.$cid.'&articlechoose='.$articlechoose.$articletableuri.'" class="actionBtn add"><em>增加</em></a>'); }elseif(isset($articleschoose)) { echo('<a href="?do=list_add&cid='.$cid.'&articleschoose='.$articleschoose.$articletableuri.'" class="actionBtn add"><em>增加</em></a>'); }else { echo('<a href="?do=list_add&cid='.$cid.$articletableuri.'" class="actionBtn add"><em>增加</em></a>'); } } ?> <a href="?do=list&cid=<?php echo($cid);?>"><?php echo($cname);?></a> <div class="searcharea"> <form name="filter" action="?do=list" method="GET"> <input type="hidden" name="do" value="list"> <?php if(!empty($articletable)) { echo('<input type="hidden" name="articletable" value="'.$articletable.'">'); } if(isset($articlechoose)) { echo('<input type="hidden" name="articlechoose" value="'.$articlechoose.'">'); } if(isset($articleschoose)) { echo('<input type="hidden" name="articlechoose" value="'.$articleschoose.'">'); } if(isset($articlemname)) { echo('<input type="hidden" name="articlemname" value="'.$articlemname.'">'); } ?> <input type="hidden" name="cid" value="<?php echo($cid);?>"> <input type="text" class="inputtext" style="width:180px" name="keyword" value="<?php if($keyword<>'') {echo(htmlspecialchars($_GET['keyword']));}?>" placeholder=""> <input class="btnsearch" type="submit" value="搜索" /> </form> </div> </h3> <div id="list"> <?php run_admin_hook($cid,'index'); ?> <table width="100%" border="0" cellpadding="8" cellspacing="0" class="tableBasic"> <tr> <th width="22" align="center">选</th> <?php foreach ($moudle as $value){ echo('<th align="center">'.$value['minfo'].'</th>'); } ?> <?php if(isset($csetting['listfidshow']) && $csetting['listfidshow']==1) { echo('<th width="80" align="center">子分类'); if(isset($fid) && $fid>0) { echo('[<a href="javascript:history.go(-1);">返回</a>]'); } echo('</th>'); } ?> <?php if(isset($csetting['listshowadminname']) && $csetting['listshowadminname']==1) { echo('<th width="100" align="center">作者</th>'); } ?> <th width="150" style="min-width:150px;" align="center">操作</th> </tr> <?php if(isset($fid) && isset($moudleid)) { $where['where'][$moudleid]=intval($fid); }else { //默认显示父分类 if(isset($csetting['listfidshow']) && $csetting['listfidshow']==1) { $where['where']['fid']=0; } } $where['order']=$ordersql; if (!isset($_GET['page'])){$where['page']=1;}else{$where['page']=intval($_GET['page']);} $where['cid']=$cid; $where['column']=getlistcolumn($cid); if (!empty($keyword)){ $where['keyword']=$keyword; $where['searchcolumn']=getlistsearchcolumn($cid); } if(isset($_COOKIE['pagesize_'.$cid])) { $where['pagesize']=intval($_COOKIE['pagesize_'.$cid]); if($where['pagesize']>999) {$where['pagesize']=999;} if($where['pagesize']<1) {$where['pagesize']=1;} }else { $where['pagesize']=15; if(isset($csetting['temppage_size']) && $csetting['temppage_size']>0) { $where['pagesize']=$csetting['temppage_size']; } } if(isset($csetting['articletable'])) {$where['tablename']=$csetting['articletable'];}else {die('栏目尚未配置完成');} if(!empty($articletable)) {$where['tablename']=$articletable;} if(power('sadmin',0) || power('s',$cid,$power,5)) {}else {if(isset($csetting['listadminuid']) && $csetting['listadminuid']==1) {$where['where']['adminuid']=$myadminuid;}}//普通用户只能编辑自己的文章 run_admin_hook($cid,'list'); $articles=alist($where); $thismoudlearray=array(); foreach ($articles['list'] as $article) { run_admin_hook($cid,'listrow'); ?> <tr> <td align="center" ><input name="delpost" type="checkbox" value="<?php echo($article['id']);?>" title='<?php echo($article['id']);?>'/> </td> <?php foreach ($moudle as $thismoudle) { if($thismoudle['mname']=='title' && empty($thismoudle['ifshowtemp']) && isset($article['link']) && strlen(trim($article['link']))>1 && $ifshowthischannel) { $thismoudle['ifshowtemp']='<a href="{link}" target="_blank">{title}</a>'; } if(strlen($thismoudle['ifshowtemp'])>3) { $thistemp=$thismoudle['ifshowtemp']; foreach ($article as $key => $articleziduan){ $thistemp=str_replace('{'.$key.'}',htmlspecialchars(@$article[$key]),$thistemp); } echo('<td align="left">'.$thistemp.'</td>'); }else { if($thismoudle['mkind']==5) { if(strlen($article[$thismoudle['mname']])>5) { echo('<td align="center" ><img class="pic" src="'.@htmlspecialchars($article[$thismoudle['mname']]).'"></td>'); }else { echo('<td align="center" >无</td>'); } }elseif($thismoudle['mkind']==6){ if(strlen(@$article[$thismoudle['mname']])>10) { echo('<td align="center" >'); $thispics=json_decode($article[$thismoudle['mname']],1); foreach($thispics as $thispic) { echo('<img class="pic" src="'.@htmlspecialchars($thispic).'">'); } echo('</td>'); }else { echo('<td align="center" >无</td>'); } }elseif($thismoudle['mkind']==9) { echo('<td width="150px" align="center">'.@date("Y-m-d H:i",@$article[$thismoudle['mname']]).'</td>'); }elseif($thismoudle['mkind']==26) { echo('<td width="150px" align="center">'); if(isset($article[$thismoudle['mname']]) && $article[$thismoudle['mname']]==1) { echo('<input type="checkbox" checked disabled>'); }else { echo('<input type="checkbox" disabled>'); } echo('</td>'); } elseif($thismoudle['mkind']==20) { $thisarray=json_decode($article[$thismoudle['mname']],1); echo('<td align="center">'); if(is_array($thisarray)) { foreach($thisarray as $value) { echo(implode(";",$value)); echo('<br>'); } } echo('</td>'); } elseif($thismoudle['mkind']==21) { if(!isset($strarray[$thismoudle['mname']])) { $thismoudlesetting=explode('|',$thismoudle['strarray']); if(count($thismoudlesetting)<>2) { echo('<td>'); htmlinput_error('list',$thismoudle['id']); } $strarray[$thismoudle['mname']]['cid']=$thismoudlesetting[0]; $strarray[$thismoudle['mname']]['mname']=$thismoudlesetting[1]; $thiscid=$strarray[$thismoudle['mname']]['cid']; if(!power('s',$thiscid,$power,2)) { $strarray[$thismoudle['mname']]['power']=false; }else { $strarray[$thismoudle['mname']]['power']=true; } $thischannel=adminchannelcache($thiscid); if($thischannel) { $strarray[$thismoudle['mname']]['tablename']=$thischannel['csetting']['articletable']; }else { echo('<td>'); htmlinput_error('list',$thismoudle['id']); } } echo('<td align="center">'); if($article[$thismoudle['mname']]>0) { if(!isset($strarray[$thismoudle['mname']]['list'][$article[$thismoudle['mname']]])) { $query = $GLOBALS['db'] -> query("SELECT id,".$strarray[$thismoudle['mname']]['mname']." FROM ".$strarray[$thismoudle['mname']]['tablename']." where id='".$article[$thismoudle['mname']]."' limit 1;"); if($thislink = $GLOBALS['db'] -> fetchone($query)) { $strarray[$thismoudle['mname']]['list'][$article[$thismoudle['mname']]]=$thislink[$strarray[$thismoudle['mname']]['mname']]; }else { $strarray[$thismoudle['mname']]['list'][$article[$thismoudle['mname']]]='<em class="warning">已删除</em>'; } } if($strarray[$thismoudle['mname']]['power']) { echo('<a href="?do=list_edit&cid='.$thiscid.'&id='.$article[$thismoudle['mname']].'" target="_blank">'.$strarray[$thismoudle['mname']]['list'][$article[$thismoudle['mname']]].'</a>'); }else { echo($strarray[$thismoudle['mname']]['list'][$article[$thismoudle['mname']]]); } } echo('</td>'); } elseif($thismoudle['mkind']==22) { if(!isset($strarray[$thismoudle['mname']])) { $thismoudlesetting=explode('|',$thismoudle['strarray']); if(count($thismoudlesetting)<>2) { echo('<td>'); htmlinput_error('list',$thismoudle['id']); } $strarray[$thismoudle['mname']]['cid']=$thismoudlesetting[0]; $strarray[$thismoudle['mname']]['mname']=$thismoudlesetting[1]; $thiscid=$strarray[$thismoudle['mname']]['cid']; if(!power('s',$thiscid,$power,2)) { $strarray[$thismoudle['mname']]['power']=false; }else { $strarray[$thismoudle['mname']]['power']=true; } $thischannel=adminchannelcache($thiscid); if($thischannel) { $strarray[$thismoudle['mname']]['tablename']=$thischannel['csetting']['articletable']; }else { echo('<td>'); htmlinput_error('list',$thismoudle['id']); } } echo('<td align="center">'); $thisstrarray=json_decode(@$article[$thismoudle['mname']],1); if(is_array($thisstrarray) && count($thisstrarray)>0) { foreach($thisstrarray as $thisvalue) { if(!isset($strarray[$thismoudle['mname']]['list'][$thisvalue])) { $query = $GLOBALS['db'] -> query("SELECT id,".$strarray[$thismoudle['mname']]['mname']." FROM ".$strarray[$thismoudle['mname']]['tablename']." where id='$thisvalue' limit 1;"); if($thislink = $GLOBALS['db'] -> fetchone($query)) { $strarray[$thismoudle['mname']]['list'][$thisvalue]=$thislink[$strarray[$thismoudle['mname']]['mname']].'<br>'; }else { $strarray[$thismoudle['mname']]['list'][$thisvalue]='<em class="warning">已删除</em><br>'; } } if($strarray[$thismoudle['mname']]['power']) { echo('<a href="?do=list_edit&cid='.$thiscid.'&id='.$thisvalue.'" target="_blank">'.$strarray[$thismoudle['mname']]['list'][$thisvalue].'</a>'); }else { echo($strarray[$thismoudle['mname']]['list'][$thisvalue]); } } } echo('</td>'); } elseif($thismoudle['mkind']==16) { echo('<td width="150px" align="center" style="color:'.$article[$thismoudle['mname']].'">'.$article[$thismoudle['mname']].'</td>'); }elseif($thismoudle['mkind']==18 || $thismoudle['mkind']==19) { $thisarray=json_decode($article[$thismoudle['mname']],1); echo('<td align="center">'); if(is_array($thisarray)) { echo(implode(";",$thisarray)); } echo('</td>'); }elseif($thismoudle['mkind']==11 ||$thismoudle['mkind']==12 || $thismoudle['mkind']==14 || $thismoudle['mkind']==8 || $thismoudle['mkind']==17) { if(!isset($strarray[$thismoudle['mname']])) { $thismoudlesetting=explode('|',$thismoudle['strarray']); if(count($thismoudlesetting)<>2) { echo('<td>'); htmlinput_error('list',$thismoudle['id']); } $strarray[$thismoudle['mname']]['cid']=$thismoudlesetting[0]; $strarray[$thismoudle['mname']]['mname']=$thismoudlesetting[1]; $thiscid=$strarray[$thismoudle['mname']]['cid']; $thischannel=adminchannelcache($thiscid); if($thischannel) { $strarray[$thismoudle['mname']]['tablename']=$thischannel['csetting']['articletable']; }else { echo('<td>'); htmlinput_error('list',$thismoudle['id']); } } $article[$thismoudle['mname']]=intval($article[$thismoudle['mname']]); $thisfid=0; if(empty($article[$thismoudle['mname']])) { $article[$thismoudle['mname']]='未选'; }else { if(isset($strarray[$thismoudle['mname']]['list'][$article[$thismoudle['mname']]])) { $thisfid=$article[$thismoudle['mname']]; $article[$thismoudle['mname']]=$strarray[$thismoudle['mname']]['list'][$article[$thismoudle['mname']]]; }else { $query = $GLOBALS['db'] -> one("SELECT id,".$strarray[$thismoudle['mname']]['mname']." FROM ".$strarray[$thismoudle['mname']]['tablename']." where id='".$article[$thismoudle['mname']]."' limit 1;"); if($query) { $strarray[$thismoudle['mname']]['list'][$article[$thismoudle['mname']]]=$query[$strarray[$thismoudle['mname']]['mname']]; $thisfid=$article[$thismoudle['mname']]; $article[$thismoudle['mname']]=$query[$strarray[$thismoudle['mname']]['mname']]; }else { $article[$thismoudle['mname']]='<em class="warning">已删除</em>'; $strarray[$thismoudle['mname']]['list'][$article[$thismoudle['mname']]]=$article[$thismoudle['mname']]; } } } if($thisfid>0) { echo('<td width="150px" align="center"><a href="?do=list&cid='.$cid.'&fid='.$thisfid.'&moudleid='.$thismoudle['mname'].'">'.$article[$thismoudle['mname']].'</a></td>'); }else { echo('<td width="150px" align="center">'.$article[$thismoudle['mname']].'</td>'); } } elseif($thismoudle['mkind']==10 || $thismoudle['mkind']==15) {//复选框 if(!isset($strarray[$thismoudle['mname']])) { $thismoudlesetting=explode('|',$thismoudle['strarray']); if(count($thismoudlesetting)<>2) { echo('<td>'); htmlinput_error('list',$thismoudle['id']); } $strarray[$thismoudle['mname']]['cid']=$thismoudlesetting[0]; $strarray[$thismoudle['mname']]['mname']=$thismoudlesetting[1]; $thiscid=$strarray[$thismoudle['mname']]['cid']; $thischannel=adminchannelcache($thiscid); if($thischannel) { $strarray[$thismoudle['mname']]['tablename']=$thischannel['csetting']['articletable']; }else { echo('<td>'); htmlinput_error('list',$thismoudle['id']); } } echo('<td align="center" >'); $inputvalues=json_decode(@$article[$thismoudle['mname']],1); if(count($inputvalues)>0) { foreach($inputvalues as $val) { $val=intval($val); if(isset($strarray[$thismoudle['mname']]['list'][$val])) { echo($strarray[$thismoudle['mname']]['list'][$val].'<br>'); }else { $query = $GLOBALS['db'] -> one("SELECT id,".$strarray[$thismoudle['mname']]['mname']." FROM ".$strarray[$thismoudle['mname']]['tablename']." where id='$val' limit 1;"); if($query) { $strarray[$thismoudle['mname']]['list'][$val]=$query[$strarray[$thismoudle['mname']]['mname']]; echo($query[$strarray[$thismoudle['mname']]['mname']].'<br>'); } } } } echo('</td>'); }elseif($thismoudle['mkind']==1){ echo('<td align="center" >'.@($article[$thismoudle['mname']]).'</td>'); }else { echo('<td align="center" >'.@htmlspecialchars($article[$thismoudle['mname']]).'</td>'); } } } ?> <?php if(isset($csetting['listfidshow']) && $csetting['listfidshow']==1) { echo('<td align="center"><a href="?do=list&cid='.$cid.$articletableuri.'&fid='.$article['id'].'&moudleid=fid">查看</a></td>'); } ?> <?php if(isset($csetting['listshowadminname']) && $csetting['listshowadminname']==1) { echo('<td width="100" align="center">'); if(isset($article['adminuid'])) { if(!isset($strarray['adminuid'][$article['adminuid']])) { $strarray['adminuid'][$article['adminuid']]= $GLOBALS['db'] -> fetchcount("SELECT nickname FROM ".tableex('admin')." where id='".$article['adminuid']."';"); } if(!$strarray['adminuid'][$article['adminuid']]) { $strarray['adminuid'][$article['adminuid']]='未知'; } echo(htmlspecialchars($strarray['adminuid'][$article['adminuid']])); }else { echo('无'); } echo('</td>'); } ?> <td align="center" class="nocolor"> <?php if(isset($articlechoose)) { $targetid=@$article['id']; $targettitle=@$article[$articlemname]; echo('<a href="javascript:;"onclick="articlechoose(\''.$articlechoose.'\',\''.$targetid.'\',\''.$targettitle.'\');" style="color:#0000FF" class="articlechoosetip" rel="'.$targetid.'">选择</a> '); } if(isset($articleschoose)) { $targetid=@$article['id']; $targettitle=@$article[$articlemname]; echo('<a href="javascript:;"onclick="this.style.color=\'#ccc\';articleschoose(\''.$articleschoose.'\',\''.$targetid.'\',\''.$targettitle.'\');" class="articleschoosetip" style="color:#0000FF" rel="'.$targetid.'">选择</a> '); } ?> <?php if((!isset($csetting['listnoedit']) || $csetting['listnoedit']==0) && power('s',$cid,$power,2)) { echo('<a href="?do=list_edit&id='.$article['id'].'&cid='.$cid.$articletableuri.'">编辑</a> '); } if((!isset($csetting['listnoadd']) || $csetting['listnoadd']==0) && power('s',$cid,$power,1)) { if(isset($csetting['listcopy']) && $csetting['listcopy']==1) { echo('<a href="?do=list_add&cid='.$cid.'&id='.$article['id'].$articletableuri.'"><em>复制</em></a> '); } } if((!isset($csetting['listnodel']) || $csetting['listnodel']==0) && power('s',$cid,$power,3)) { echo('<a href="javascript:;" onclick="javascript:confirmurl(\'?do=list_del&'.newtoken(3).'&id='.$article['id'].$articletableuri.'&cid='.$cid.'\',\'确定删除此条信息吗?\');">删除</a>'); } ?> </td> </tr> <?php unset($article); } ?> </table> <div class="action"> <?php if((!isset($csetting['listnodel']) || $csetting['listnodel']==0) && power('s',$cid,$power,3)) { ?> <a href="javascript:Sel('all','delpost')">全选</a> <a href="javascript:Sel('no','delpost')">反选</a> <a href="javascript:checkSubmit('delpost','?do=list_del<?php echo($articletableuri);?>&<?php echo(newtoken(2));?>')">删除</a> <?php } ?> </div> <div class="pager"> 总计 <?php echo($articles['pagecount']);?> 个记录, 每页 <input type="text" name="pagesize" id="pagesize" value="<?php echo($where['pagesize']);?>" autocomplete="off"> 条 当前第 <?php echo($articles['page']);?> 页 | <?php $pageurl='?page={page}'; foreach($_GET as $key=>$val) { if($key<>'page') { $pageurl.='&'.$key.'='.$val; } } adminpagelist($articles['pagecount'],$articles['pagesize'],$articles['page'],3,$pageurl); ?> </div> </form> </div> </div> </div> <script type="text/javascript"> function Sel(stype,na){ for(var i=0; i< document.getElementsByName(na).length;i++){ if(stype=='all') document.getElementsByName(na)[i].checked=true; else if (document.getElementsByName(na)[i].checked==false) { document.getElementsByName(na)[i].checked=true; }else{ document.getElementsByName(na)[i].checked=false; } } } function checkSubmit(na,url) { var str = ''; for(var i=0;i < document.getElementsByName(na).length;i++) { if(document.getElementsByName(na)[i].checked){ if(str=='') str += document.getElementsByName(na)[i].value; else str += '_' + document.getElementsByName(na)[i].value; } } if(str=='') { alert('你没选择任何内容!'); return false; } else { if (confirm('是否确认删除?')){ window.location.href=url+"&cid=<?php echo($cid);?>&id="+str; }else{ return false } } } $(function(){ $('#pagesize').change(function(){ setCookie('pagesize_<?php echo($cid);?>',$(this).val()); }); $('#pagesize').keydown(function(event){ if(event.which == 13){ setCookie('pagesize_<?php echo($cid);?>',$(this).val()); window.location.reload(); } }); }); </script> <?php if(isset($articlechoose)) { ?> <script type="text/javascript"> function articlechoose(htmlid,id,title){ $('[name="'+htmlid+'"]',window.opener.document).val(id); $('#'+htmlid,window.opener.document).html('<a href="?do=list_edit&id='+id+'&cid=<?php echo($cid);?>" target="_blank">'+title+'</a><span></span>'); window.close(); } $(function(){ <?php echo($articlechoose);?>_chosed=$('[name="<?php echo($articlechoose);?>"]',window.opener.document).val(); $("#list .articlechoosetip[rel='"+<?php echo($articlechoose);?>_chosed+"']").text('已选'); $("#list .articlechoosetip[rel='"+<?php echo($articlechoose);?>_chosed+"']").css('color','#ccc'); }); </script> <?php } if(isset($articleschoose)) { ?> <script type="text/javascript"> function articleschoose(htmlid,id,title){ var ifin=0; $('#'+htmlid+' li',window.opener.document).each(function(){ if (id==$(this).children('input').val()) { ifin=1; } }); if (ifin==0) { $('#'+htmlid,window.opener.document).append('<li><a href="?do=list_edit&id='+id+'&cid=<?php echo($cid);?>" target="_blank">'+title+'</a><span></span><input type="hidden" name="'+htmlid+'[]" value="'+id+'"></li>'); } } $(function(){ $('#<?php echo($articleschoose);?> li',window.opener.document).each(function(){ thisvar=$(this).children('input').val(); $("#list .articleschoosetip[rel='"+thisvar+"']").text('已选'); $("#list .articleschoosetip[rel='"+thisvar+"']").css('color','#ccc'); }); }); </script> <?php } ?>